#ifndef SRC_S2E_PLUGINS_PYTHON_UTILS_H_
#define SRC_S2E_PLUGINS_PYTHON_UTILS_H_

#include "xtypes.h"
#include <Python.h>

//! The s2e namespace
namespace s2e {
  namespace plugins {
    namespace python {
      //! Returns a bool from a pyObject.
      bool PyLong_AsBool(PyObject* obj);

      //! Returns a s2e::__uint from a pyObject.
      s2e::__uint PyLong_AsUint(PyObject* obj);

      //! Returns a s2e::usize from a pyObject.
      s2e::usize PyLong_AsUsize(PyObject* obj);

      //! Returns a s2e::uint32 from a pyObject.
      s2e::uint32 PyLong_AsUint32(PyObject* obj);

      //! Returns a s2e::uint64 from a pyObject.
      s2e::uint64 PyLong_AsUint64(PyObject* obj);

      //! Returns a s2e::uint128 from a pyObject.
      s2e::uint128 PyLong_AsUint128(PyObject* obj);

      //! Returns a s2e::uint256 from a pyObject.
      s2e::uint256 PyLong_AsUint256(PyObject* obj);

      //! Returns a s2e::uint512 from a pyObject.
      s2e::uint512 PyLong_AsUint512(PyObject* obj);

      //! Returns a pyObject from a s2e::__uint.
      PyObject* PyLong_FromUint(s2e::__uint value);

      //! Returns a pyObject from a s2e::usize.
      PyObject* PyLong_FromUsize(s2e::usize value);

      //! Returns a pyObject from a s2e::uint32.
      PyObject* PyLong_FromUint32(s2e::uint32 value);

      //! Returns a pyObject from a s2e::uint64.
      PyObject* PyLong_FromUint64(s2e::uint64 value);

      //! Returns a pyObject from a s2e::uint128.
      PyObject* PyLong_FromUint128(s2e::uint128 value);

      //! Returns a pyObject from a s2e::uint256.
      PyObject* PyLong_FromUint256(s2e::uint256 value);

      //! Returns a pyObject from a s2e::uint512.
      PyObject* PyLong_FromUint512(s2e::uint512 value);

    };
  };
};

#endif /* SRC_S2E_PLUGINS_PYTHON_UTILS_H_ */
